package com.meichis.yndms.model;

import java.io.Serializable;

/**
 * Created by pei on 2016/8/24.
 */
public class VisitWorkItem_DisplayCheck implements Serializable {
    //归属拜访环节
    private int Job;
    //品牌
    private int Brand;
    //是否本品
    private int BrandType;
    //品类
    private String PDTClassify = "";
    //陈列方式
    private int DisplayType;
    //设备ID
    private int Equipment;
    //设备编码
    private String EquipmentCode = "";
    //设备纯度
    private String EquipmentPurity = "";
    //设备巡检状态
    private int EquipmentCheckState;
    //是否通电
    private int EquipmentPowerOn;
    //排面列数(排面个数、排面数、台)
    private int ColumnCount;

    private int ColumnTotalCount;
    //排面层数
    private int TierCount;
    //排面宽度
    private double DisplayWidth;
    //陈列级别
    private int DisplayLevel;
    //照片列表
    private String PhotosGUID = "";
    //备注
    private String Remark = "";
    //是否我司付费
    private String IsOurCompanyPay = "";
    //是否是门店固定资产
    private boolean isAsset;

    public int getJob() {
        return Job;
    }

    public void setJob(int job) {
        Job = job;
    }

    public int getBrand() {
        return Brand;
    }

    public void setBrand(int brand) {
        Brand = brand;
    }

    public int getBrandType() {
        return BrandType;
    }

    public void setBrandType(int brandType) {
        BrandType = brandType;
    }

    public String getPDTClassify() {
        return PDTClassify;
    }

    public void setPDTClassify(String PDTClassify) {
        this.PDTClassify = PDTClassify;
    }

    public int getEquipment() {
        return Equipment;
    }

    public void setEquipment(int equipment) {
        Equipment = equipment;
    }

    public String getEquipmentCode() {
        return EquipmentCode;
    }

    public void setEquipmentCode(String equipmentCode) {
        EquipmentCode = equipmentCode;
    }

    public String getEquipmentPurity() {
        return EquipmentPurity;
    }

    public void setEquipmentPurity(String equipmentPurity) {
        EquipmentPurity = equipmentPurity;
    }

    public int getEquipmentCheckState() {
        return EquipmentCheckState;
    }

    public void setEquipmentCheckState(int equipmentCheckState) {
        EquipmentCheckState = equipmentCheckState;
    }

    public int getEquipmentPowerOn() {
        return EquipmentPowerOn;
    }

    public void setEquipmentPowerOn(int equipmentPowerOn) {
        EquipmentPowerOn = equipmentPowerOn;
    }

    public int getColumnCount() {
        return ColumnCount;
    }

    public void setColumnCount(int columnCount) {
        ColumnCount = columnCount;
    }

    public int getColumnTotalCount() {
        return ColumnTotalCount;
    }

    public void setColumnTotalCount(int columnTotalCount) {
        ColumnTotalCount = columnTotalCount;
    }

    public int getTierCount() {
        return TierCount;
    }

    public void setTierCount(int tierCount) {
        TierCount = tierCount;
    }

    public double getDisplayWidth() {
        return DisplayWidth;
    }

    public void setDisplayWidth(double displayWidth) {
        DisplayWidth = displayWidth;
    }

    public int getDisplayLevel() {
        return DisplayLevel;
    }

    public void setDisplayLevel(int displayLevel) {
        DisplayLevel = displayLevel;
    }

    public String getPhotosGUID() {
        return PhotosGUID;
    }

    public void setPhotosGUID(String photosGUID) {
        PhotosGUID = photosGUID;
    }

    public String getRemark() {
        return Remark;
    }

    public void setRemark(String remark) {
        Remark = remark;
    }

    public int getDisplayType() {
        return DisplayType;
    }

    public void setDisplayType(int displayType) {
        DisplayType = displayType;
        if (Brand == 1) {//本品Display变化，清除其他数据
            switch (DisplayType) {
                case 1:
                    ColumnTotalCount = 0;
                    ColumnCount = 0;
                    DisplayWidth = 0d;
                    DisplayLevel = 0;
                    IsOurCompanyPay = "";
                    break;
                case 2:
                    ColumnTotalCount = 0;
                    EquipmentCode = "";
                    EquipmentPurity = "";
                    EquipmentCheckState = 0;
                    EquipmentPowerOn = 0;
                    TierCount = 0;
                    DisplayWidth = 0d;
                    DisplayLevel = 0;
                    IsOurCompanyPay = "";
                    break;
                case 3:
                    ColumnTotalCount = 0;
                    EquipmentCode = "";
                    EquipmentCheckState = 0;
                    TierCount = 0;
                    DisplayWidth = 0d;
                    DisplayLevel = 0;
                    IsOurCompanyPay = "";
                    break;
                case 4:
                    ColumnTotalCount = 0;
                    EquipmentCode = "";
                    EquipmentPurity = "";
                    EquipmentCheckState = 0;
                    EquipmentPowerOn = 0;
                    DisplayWidth = 0d;
                    DisplayLevel = 0;
                    IsOurCompanyPay = "";
                    break;
                case 5:
                    ColumnTotalCount = 0;
                    EquipmentCheckState = 0;
                    EquipmentPowerOn = 0;
                    ColumnCount = 0;
                    TierCount = 0;
                    DisplayWidth = 0d;
                    DisplayLevel = 0;
                    IsOurCompanyPay = "";
                    break;
                case 6:
                    ColumnTotalCount = 0;
                    EquipmentCode = "";
                    EquipmentPurity = "";
                    EquipmentCheckState = 0;
                    EquipmentPowerOn = 0;
                    ColumnCount = 0;
                    DisplayLevel = 0;
                    IsOurCompanyPay = "";
                    break;
                case 7:
                    ColumnTotalCount = 0;
                    EquipmentCode = "";
                    EquipmentPurity = "";
                    EquipmentCheckState = 0;
                    EquipmentPowerOn = 0;
                    DisplayLevel = 0;
                    DisplayWidth = 0d;
                    IsOurCompanyPay = "";
                    break;
                case 11:
                    ColumnTotalCount = 0;
                    EquipmentCode = "";
                    EquipmentPurity = "";
                    EquipmentCheckState = 0;
                    EquipmentPowerOn = 0;
                    ColumnCount = 0;
                    DisplayLevel = 0;
                    break;
                case 12:
                    EquipmentCode = "";
                    EquipmentPurity = "";
                    EquipmentCheckState = 0;
                    EquipmentPowerOn = 0;
                    break;
                case 13:
                case 14:
                case 15:
                case 16:
                case 17:
                case 18:
                    EquipmentCode = "";
                    EquipmentPurity = "";
                    EquipmentCheckState = 0;
                    EquipmentPowerOn = 0;
                    ColumnTotalCount = 0;
                    TierCount = 0;
                    DisplayWidth = 0d;
                    DisplayLevel = 0;
                    break;
            }
        }
    }

    public String isFillComplete() {
        String result = null;
        if (BrandType == 1) {//本品检查
            switch (DisplayType) {
                case 1:
                    if (EquipmentPurity.trim().equals("")) {
                        result = "冰柜纯度";
                        return result;
                    }
                    if (EquipmentCode.trim().equals("")) {
                        result = "冰柜资产号";
                        return result;
                    }
                    if (TierCount == 0) {
                        result = "冰柜排面层数";
                        return result;
                    }
                    break;
                case 2:
                    if (ColumnCount == 0) {
                        result = "冰船台";
                        return result;
                    }
                    break;
                case 3:
                    if (EquipmentPurity.trim().equals("")) {
                        result = "风幕柜纯度";
                        return result;
                    }
                    if (ColumnCount == 0) {
                        result = "风幕柜台";
                        return result;
                    }
                    break;
                case 4:
                    if (ColumnCount == 0) {
                        result = "货架排面个数";
                        return result;
                    }
                    if (TierCount == 0) {
                        result = "货架排面层数";
                        return result;
                    }
                    break;
                case 5:
                    if (EquipmentPurity.trim().equals("")) {
                        result = "贩售机纯度";
                        return result;
                    }
                    if (EquipmentCode.trim().equals("")) {
                        result = "贩售机资产号";
                        return result;
                    }
                    break;
                case 6:
                    if (DisplayWidth == 0) {
                        result = "冷风柜陈列米数";
                        return result;
                    }
                    if (TierCount == 0) {
                        result = "冷风柜陈列层数";
                        return result;
                    }
                    break;
                case 7:
                    if (ColumnCount == 0) {
                        result = "其他排面数";
                        return result;
                    }
                    if (TierCount == 0) {
                        result = "其他陈列层数";
                        return result;
                    }
                    break;
                case 11:
                    if (DisplayWidth == 0) {
                        result = "排面宽度(米)";
                        return result;
                    }
                    if (TierCount == 0) {
                        result = "排面层数";
                        return result;
                    }
                    break;
                case 12:
                    if (DisplayLevel == 0) {
                        result = "陈列位置";
                    }
                    if (ColumnTotalCount == 0) {
                        result = "奶粉总排面数";
                    }
                    if (ColumnCount == 0) {
                        result = "伊利奶粉排面数";
                    }
                    if (DisplayWidth == 0) {
                        result = "排面宽度(米)";
                        return result;
                    }
                    if (TierCount == 0) {
                        result = "排面层数";
                        return result;
                    }
                    break;
                case 13:
                case 14:
                case 15:
                case 16:
                case 17:
                case 18:
                    if (ColumnCount == 0) {
                        result = "数量";
                        return result;
                    }
                    break;
            }
            if (PhotosGUID.trim().equals("")) {//如果取消照片检查，请确保执行Pic2GUID
                result = "本品陈列实时照片";
                return result;
            }
            if (PDTClassify.trim().equals("")) {
                result = "本品陈列产品品类";
                return result;
            }
        } else {
            if (PhotosGUID.trim().equals("")) {//如果取消照片检查，请确保执行Pic2GUID
                result = "竞品陈列实时照片";
                return result;
            }

            if (Remark.trim().equals("")) {
                result = "说明";
                return result;
            }
        }
        return result;
    }

    public String getIsOurCompanyPay() {
        return IsOurCompanyPay;
    }

    public void setIsOurCompanyPay(String isOurCompanyPay) {
        IsOurCompanyPay = isOurCompanyPay;
    }

    public boolean isAsset() {
        return isAsset;
    }

    public void setAsset(boolean asset) {
        isAsset = asset;
    }

//    public String Pic2GUID() {
//        PhotosGUID = "";
//        if (pictures != null && pictures.size() > 0) {
//            for (Picture picture : pictures) {
//                PhotosGUID = PhotosGUID + "|" + picture.getGuid();
//            }
//            PhotosGUID = PhotosGUID.substring(1);
//        } else {
//            PhotosGUID = "";
//        }
//        return PhotosGUID;
//    }
}
